<template>
  <div class="home">
    <!-- 我宣誓 -->
    <!-- <img alt="Vue logo" src="../assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js App"/> -->
    <!-- <son></son> -->
    <!-- <son aa="123"></son> -->
    <son></son>
    <son></son>
   
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
import son from '@/components/Son.vue'
import { getCurrentInstance} from 'vue'
import {ref} from 'vue'
export default {
  name: 'HomeView',
  components: {
    HelloWorld,
    son
  },
  setup(props) {
    // console.log(getCurrentInstance())
    const {proxy} = getCurrentInstance()
   proxy.$axios.get('data.json').then(res=>{
    console.log(res);
   })
//    函数
   const fn1 = ()=>{
   
    console.log('我是父组件的函数，我要传给子组件');
   }
   const obj = ref({
    name:'zs'
   })
   const arr = ref([1,2,3,4,5])
   return {fn1,obj,arr}
  }
}
</script>
